export function setStorage(key: string, value: any) {
  uni.setStorageSync(key, value);
}

export function getStorage(key: string) {
  return uni.getStorageSync(key);
}
export function clearStorage() {
  uni.clearStorageSync();
}

export const Token = {
  set(value: any) {
    setStorage("ACCEPT_TOKEN", value);
  },
  get() {
    return getStorage("ACCEPT_TOKEN");
  },
  remove() {
    setStorage("ACCEPT_TOKEN", "");
  }
};

export const AIToken = {
  set(value: any) {
    setStorage("AI_TOKEN", value);
  },
  get() {
    return getStorage("AI_TOKEN");
  },
  remove() {
    setStorage("AI_TOKEN", "");
  }
};

export const Tab = {
  set(value: any) {
    setStorage("TAB_HISTORY", value);
  },
  get() {
    return getStorage("TAB_HISTORY");
  },
  remove() {
    setStorage("TAB_HISTORY", "");
  }
};
